<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    
    <title>系统安装二三事 | jouyouyun&#39;s blog</title>
    <meta name="viewport" content="width=device-width,minimum-scale=1">
    <meta name="description" content="在重装系统时, 需要考虑软件与数据的备份恢复, 遂记录下需要用到的软件, 自定义的配置和数据恢复.
软件
换源

Archlinux
">
    <meta name="generator" content="Hugo 0.105.0">
    
    
    
    
      <meta name="robots" content="noindex, nofollow">
    

    
<link rel="stylesheet" href="/ananke/css/main.min.css" >



    
    
    
      

    

    
    
    <meta property="og:title" content="系统安装二三事" />
<meta property="og:description" content="在重装系统时, 需要考虑软件与数据的备份恢复, 遂记录下需要用到的软件, 自定义的配置和数据恢复.
软件
换源

Archlinux
" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://jouyouyun.github.io/post/installation/" /><meta property="article:section" content="post" />
<meta property="article:published_time" content="2019-05-02T11:27:00+08:00" />
<meta property="article:modified_time" content="2019-10-16T14:59:59+08:00" />

<meta itemprop="name" content="系统安装二三事">
<meta itemprop="description" content="在重装系统时, 需要考虑软件与数据的备份恢复, 遂记录下需要用到的软件, 自定义的配置和数据恢复.
软件
换源

Archlinux
"><meta itemprop="datePublished" content="2019-05-02T11:27:00+08:00" />
<meta itemprop="dateModified" content="2019-10-16T14:59:59+08:00" />
<meta itemprop="wordCount" content="357">
<meta itemprop="keywords" content="installation," /><meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="系统安装二三事"/>
<meta name="twitter:description" content="在重装系统时, 需要考虑软件与数据的备份恢复, 遂记录下需要用到的软件, 自定义的配置和数据恢复.
软件
换源

Archlinux
"/>

	
  </head>

  <body class="ma0 avenir bg-near-white">

    
   
  

  <header>
    <div class="bg-black">
      <nav class="pv3 ph3 ph4-ns" role="navigation">
  <div class="flex-l justify-between items-center center">
    <a href="/" class="f3 fw2 hover-white no-underline white-90 dib">
      
        jouyouyun&#39;s blog
      
    </a>
    <div class="flex-l items-center">
      

      
        <ul class="pl0 mr3">
          
          <li class="list f5 f4-ns fw4 dib pr3">
            <a class="hover-white no-underline white-90" href="/post/" title="Archives 页">
              Archives
            </a>
          </li>
          
          <li class="list f5 f4-ns fw4 dib pr3">
            <a class="hover-white no-underline white-90" href="/tags/" title="Tags 页">
              Tags
            </a>
          </li>
          
          <li class="list f5 f4-ns fw4 dib pr3">
            <a class="hover-white no-underline white-90" href="/categories/" title="Categories 页">
              Categories
            </a>
          </li>
          
        </ul>
      
      
<div class="ananke-socials">
  
    <a href="https://github.com/jouyouyun" target="_blank" class="github ananke-social-link link-transition stackoverflow link dib z-999 pt3 pt0-l mr1" title="GitHub link" rel="noopener" aria-label="follow on GitHub——Opens in a new window">
      
        <span class="icon"><svg style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512"  xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
  <path d="M256,32C132.3,32,32,134.8,32,261.7c0,101.5,64.2,187.5,153.2,217.9c11.2,2.1,15.3-5,15.3-11.1   c0-5.5-0.2-19.9-0.3-39.1c-62.3,13.9-75.5-30.8-75.5-30.8c-10.2-26.5-24.9-33.6-24.9-33.6c-20.3-14.3,1.5-14,1.5-14   c22.5,1.6,34.3,23.7,34.3,23.7c20,35.1,52.4,25,65.2,19.1c2-14.8,7.8-25,14.2-30.7c-49.7-5.8-102-25.5-102-113.5   c0-25.1,8.7-45.6,23-61.6c-2.3-5.8-10-29.2,2.2-60.8c0,0,18.8-6.2,61.6,23.5c17.9-5.1,37-7.6,56.1-7.7c19,0.1,38.2,2.6,56.1,7.7   c42.8-29.7,61.5-23.5,61.5-23.5c12.2,31.6,4.5,55,2.2,60.8c14.3,16.1,23,36.6,23,61.6c0,88.2-52.4,107.6-102.3,113.3   c8,7.1,15.2,21.1,15.2,42.5c0,30.7-0.3,55.5-0.3,63c0,6.1,4,13.3,15.4,11C415.9,449.1,480,363.1,480,261.7   C480,134.8,379.7,32,256,32z"/>
</svg>
</span>
      
<span class="new-window"><svg  height="8px"  style="enable-background:new 0 0 1000 1000;" version="1.1" viewBox="0 0 1000 1000"  xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
<path d="M598 128h298v298h-86v-152l-418 418-60-60 418-418h-152v-86zM810 810v-298h86v298c0 46-40 86-86 86h-596c-48 0-86-40-86-86v-596c0-46 38-86 86-86h298v86h-298v596h596z" style="fill-rule:evenodd;clip-rule:evenodd;"/>
</svg>
</span></a>
  
</div>

    </div>
  </div>
</nav>

    </div>
  </header>



    <main class="pb7" role="main">
      
  
  <article class="flex-l flex-wrap justify-between mw8 center ph3">
    <header class="mt4 w-100">
      <aside class="instapaper_ignoref b helvetica tracked">
          
        POSTS
      </aside>
      










  <div id="sharing" class="mt3 ananke-socials">
    
  </div>


      <h1 class="f1 athelas mt3 mb1">系统安装二三事</h1>
      
      <p class="tracked">
         <strong>jouyouyun</strong>
      </p>
      
      
      
      <time class="f6 mv4 dib tracked" datetime="2019-05-02T11:27:00+08:00">五月 2, 2019</time>
      

      
      
    </header>
    <div class="nested-copy-line-height lh-copy serif f4 nested-links mid-gray pr4-l w-two-thirds-l"><p>在重装系统时, 需要考虑软件与数据的备份恢复, 遂记录下需要用到的软件, 自定义的配置和数据恢复.</p>
<h2 id="软件">软件</h2>
<h3 id="换源">换源</h3>
<ul>
<li><code>Archlinux</code></li>
</ul>
<p>在 <code>/etc/pacman.d/mirrorlist</code> 只启用中国区的源, 另添加以下内容到 <code>/etc/pacman.conf</code> 中来启用 <code>yaourt aur</code> 源:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span><span style="color:#f92672">[</span>archlinuxcn<span style="color:#f92672">]</span>
</span></span><span style="display:flex;"><span>SigLevel <span style="color:#f92672">=</span> Optional TrustAll
</span></span><span style="display:flex;"><span>Server <span style="color:#f92672">=</span> https://mirrors.ustc.edu.cn/archlinuxcn/$arch~
</span></span></code></pre></div><ul>
<li>
<p><code>Deepin</code></p>
<p>这里使用 <code>163</code> 的源</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>http://mirrors.163.com/deepin stable main contrib non-free
</span></span></code></pre></div><p>具体的 <code>distribution</code>, <code>componments</code> 则根据安装后默认的源来填写.</p>
</li>
</ul>
<h3 id="输入法">输入法</h3>
<ul>
<li>
<p><code>Archlinux</code></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>yaourt -S fcitx fcitx-googlepinyin fcitx-gtk2 fcitx-gtk3 fcitx-qt5 fcitx-ui-light
</span></span></code></pre></div></li>
<li>
<p><code>Deepin</code></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>sudo apt-get install fcitx-googlepinyin
</span></span><span style="display:flex;"><span><span style="color:#75715e"># remove sogoupinyin</span>
</span></span><span style="display:flex;"><span>sudo apt-get purge sogoupinyin fcitx-sogoupinyin-uk
</span></span></code></pre></div></li>
</ul>
<h3 id="常用工具">常用工具</h3>
<ul>
<li>
<p><code>Archlinux</code></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>yaourt -S zsh tmux gvim openssh most firefox albert parcellite the_silver_searcher wget xelatex wkhtmltopdf pandoc vlc terminator git emacs w3m curl <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>dia inkscape  wps-office aria2 mpv htop gpicview deepin-screenshot foxitreader python-pip
</span></span></code></pre></div></li>
<li>
<p><code>Deepin</code></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>sudo apt-get install zsh tmux vim-gtk3 openssh-server parcellite silversearcher-ag texlive-xetex wkhtmltopdf pandoc vlc zhcon terminator git emacs w3m <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>curl dia inkscape wireshark wps-office aria2 mpv htop gpicview deepin-screenshot foxitreader python-pip python3-pip
</span></span></code></pre></div><p><code>firefox, albert</code> 另外安装</p>
</li>
</ul>
<h3 id="开发">开发</h3>
<ul>
<li>
<p><code>Archlinux</code></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>yaourt -S valgrind ctags go hugo boost boost-libs nodejs d-feet devhelp cmake clang astyle
</span></span></code></pre></div></li>
<li>
<p><code>Deepin</code></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>sudo apt-get install valgrind exuberant-ctags golang-go golang-src hugo libboost-all-dev nodejs-bin d-feet devhelp cmake clang clang-format libclang-dev astyle <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>libpython-dev
</span></span><span style="display:flex;"><span>sudo apt-get build-dep dde-daemon startdde dde-api
</span></span></code></pre></div></li>
</ul>
<h2 id="配置">配置</h2>
<ul>
<li>
<p><code>nodjs</code></p>
<p>设置 <code>npm</code> 加速镜像源与全局目录:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span><span style="color:#75715e"># ~/.npmrc</span>
</span></span><span style="display:flex;"><span>registry <span style="color:#f92672">=</span> http://registry.cnpmjs.org
</span></span><span style="display:flex;"><span>prefix<span style="color:#f92672">=</span>/Data/npm-global
</span></span></code></pre></div></li>
<li>
<p><code>pip</code></p>
<p>设置 <code>pip</code> 加速镜像源:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span><span style="color:#75715e"># ~/.pip/pip.conf</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>global<span style="color:#f92672">]</span>
</span></span><span style="display:flex;"><span>index-url <span style="color:#f92672">=</span> https://pypi.douban.com/simple
</span></span></code></pre></div></li>
<li>
<p><code>docker</code></p>
<p>设置 <code>pip</code> 加速镜像源:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span><span style="color:#75715e"># /etc/docker/daemon.json</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">{</span>
</span></span><span style="display:flex;"><span>  <span style="color:#e6db74">&#34;registry-mirrors&#34;</span>: <span style="color:#f92672">[</span><span style="color:#e6db74">&#34;https://registry.docker-cn.com&#34;</span><span style="color:#f92672">]</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">}</span>
</span></span></code></pre></div><p>存储目录的设置参见: <a href="http://jouyouyun.github.io/post/docker-data-storage/">更改 Docker 数据的存储目录</a></p>
</li>
<li>
<p><code>hosts</code></p>
<p>之前用到的设置，重装之前备份好。</p>
</li>
<li>
<p><code>sysctl.conf</code></p>
<p>文件最大打开数目， <code>tcp</code> 相关的配置</p>
</li>
<li>
<p><code>coredump</code></p>
<p>安装 <code>systemd-coredump</code> 并在 <code>/etc/sysctl.conf</code> 中添加 <code>coredump</code> 的配置。</p>
</li>
<li>
<p><code>/etc/systemd/</code></p>
<p>此目录下的配置文件的修改需要记录，如 <code>logind.conf</code> 中 <code>lid</code> 相关动作的处理方法。</p>
</li>
<li>
<p>项目的配置文件</p>
<p>统一将各个项目的配置文件放在 <code>/Data/Projects/Configurations</code> 下面，重装前备份。</p>
</li>
<li>
<p><code>IO</code> 调度算法</p>
<p>系统一般所在的硬盘识别符为 <code>sda</code> ，双硬盘的可能是其它名称，使用 <code>df -h</code> 确定。
<code>SSD</code> 硬盘可以使用 <code>noop</code> 调度算法。</p>
<ul>
<li>
<p>查看当前值： <code>cat /sys/block/sda/queue/scheduler</code></p>
<ul>
<li><code>noop</code> : <code>FIFO</code> 队列类型，使用于 <code>IO</code> 无压力的硬盘，如 <code>SSD</code> ，闪存设备， <code>RAM</code> 等</li>
<li><code>deadline</code> ：为每次请求都设置截至时间，读写分离在不同的队列中，使用于大吞吐量的场景，如数据库环境</li>
<li><code>cfq</code> : 默认值，完全公平队列，为每个进程都创建队列，然后使用时间片轮转处理进程的队列。是前两种的折中方案，使用于多媒体应用，桌面系统等。</li>
</ul>
</li>
<li>
<p>修改： <code>echo noop | sudo tee /sys/block/sda/queue/scheduler</code></p>
</li>
<li>
<p>持久化： 添加 <code>elevator=noop</code> 到 <code>/etc/default/grub</code> 中的 <code>GRUB_CMDLINE_LINUX</code> 中，然后使用 <code>sudo grub-mkconfig -o /boot/grub/grub.cfg</code> 更新启动项。</p>
</li>
</ul>
</li>
<li>
<p><code>virtualbox</code></p>
<p>需要备份 <code>~/.config/VirtualBox</code> 和镜像文件</p>
</li>
<li>
<p><code>terminator</code></p>
<p>需要备份 <code>~/.config/terminator/</code> 和镜像文件</p>
</li>
<li>
<p><code>HIDPI</code></p>
<p>需要备份 <code>grub</code> 和 <code>console</code> 的 <code>HIDPI</code> 配置</p>
</li>
<li>
<p><code>nvidia prime</code></p>
<p>需要备份相关的配置文件</p>
</li>
<li>
<p>内核模块配置</p>
<p>需要备份 <code>/etc/modprobe.d/</code> 中的设置，如 <code>dell inspiron 7590</code> 的声卡就需要更改参数</p>
</li>
<li>
<p>透明代理配置</p>
<p><code>shadowsocks, ss-tproxy, v2ray</code> 的配置需要备份</p>
</li>
<li>
<p>文档</p>
<p>备份 <code>zeal</code> 的文档</p>
</li>
<li>
<p>开机启动</p>
<p>备份自定义的开机启动</p>
</li>
<li>
<p>其它</p>
<p><code>vim, tmux, git, ssh, ss-tproxy</code> 的配置在 <a href="https://gitee.com/jouyouyun/conf.d">conf.d</a> 中, <code>emacs</code> 的配置在 <a href="https://github.com/jouyouyun/prelude">prelude</a> 中.</p>
<p><code>ss-tproxy</code> 执行 <code>git clone https://github.com/zfl9/ss-tproxy.git</code> 下载，需要安装 <code>ipset, chinadns, dnsmasq</code> 等依赖。</p>
</li>
</ul>
<h2 id="数据">数据</h2>
<p>由于将数据都单独保存在分区 <code>/Data</code> 中, 所以重装系统时只要不将其格式化就好, 装好后在修改 <code>/etc/fstab</code> 挂载上去, 如:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>UUID<span style="color:#f92672">=</span>6f8f77fb-f8ca-43cb-bb40-4e8e7ca8e009   /Data           ext4        rw,relatime,data<span style="color:#f92672">=</span>ordered    <span style="color:#ae81ff">0</span> <span style="color:#ae81ff">1</span>
</span></span></code></pre></div><ul class="pa0">
  
   <li class="list di">
     <a href="/tags/installation" class="link f5 grow no-underline br-pill ba ph3 pv2 mb2 dib black sans-serif">installation</a>
   </li>
  
</ul>
<div class="mt6 instapaper_ignoref">
      
      
      </div>
    </div>

    <aside class="w-30-l mt6-l">




</aside>

  </article>

    </main>
    <footer class="bg-black bottom-0 w-100 pa3" role="contentinfo">
  <div class="flex justify-between">
  <a class="f4 fw4 hover-white no-underline white-70 dn dib-ns pv2 ph3" href="https://jouyouyun.github.io" >
    &copy;  jouyouyun 2023 
  </a>
    <div>
<div class="ananke-socials">
  
    <a href="https://github.com/jouyouyun" target="_blank" class="github ananke-social-link link-transition stackoverflow link dib z-999 pt3 pt0-l mr1" title="GitHub link" rel="noopener" aria-label="follow on GitHub——Opens in a new window">
      
        <span class="icon"><svg style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512"  xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
  <path d="M256,32C132.3,32,32,134.8,32,261.7c0,101.5,64.2,187.5,153.2,217.9c11.2,2.1,15.3-5,15.3-11.1   c0-5.5-0.2-19.9-0.3-39.1c-62.3,13.9-75.5-30.8-75.5-30.8c-10.2-26.5-24.9-33.6-24.9-33.6c-20.3-14.3,1.5-14,1.5-14   c22.5,1.6,34.3,23.7,34.3,23.7c20,35.1,52.4,25,65.2,19.1c2-14.8,7.8-25,14.2-30.7c-49.7-5.8-102-25.5-102-113.5   c0-25.1,8.7-45.6,23-61.6c-2.3-5.8-10-29.2,2.2-60.8c0,0,18.8-6.2,61.6,23.5c17.9-5.1,37-7.6,56.1-7.7c19,0.1,38.2,2.6,56.1,7.7   c42.8-29.7,61.5-23.5,61.5-23.5c12.2,31.6,4.5,55,2.2,60.8c14.3,16.1,23,36.6,23,61.6c0,88.2-52.4,107.6-102.3,113.3   c8,7.1,15.2,21.1,15.2,42.5c0,30.7-0.3,55.5-0.3,63c0,6.1,4,13.3,15.4,11C415.9,449.1,480,363.1,480,261.7   C480,134.8,379.7,32,256,32z"/>
</svg>
</span>
      
<span class="new-window"><svg  height="8px"  style="enable-background:new 0 0 1000 1000;" version="1.1" viewBox="0 0 1000 1000"  xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
<path d="M598 128h298v298h-86v-152l-418 418-60-60 418-418h-152v-86zM810 810v-298h86v298c0 46-40 86-86 86h-596c-48 0-86-40-86-86v-596c0-46 38-86 86-86h298v86h-298v596h596z" style="fill-rule:evenodd;clip-rule:evenodd;"/>
</svg>
</span></a>
  
</div>
</div>
  </div>
</footer>

  </body>
</html>
